<div nz-row class="item">
  <div nz-col nzSpan="22"></div>
  <div nz-col nzSpan="2"><button nz-button nzType="primary" (click)="showModal()">添加</button></div>
</div>
<nz-table #basicTable [nzData]="list">
  <thead>
  <tr>
    <th>id</th>
    <th>名称</th>
    <th>备注</th>
    <th>操作</th>
  </tr>
  </thead>
  <tbody>
  <tr *ngFor="let item of list">
    <td>{{ item._id }}</td>
    <td>{{ item.title }}</td>
    <td>{{ item.description }}</td>
    <td>
      <button nz-button nzType="dashed" (click)="showModalAuth(item)">授权</button>
      <button nz-button nzType="primary" (click)="showModal(item)">修改</button>
      <button nz-button nzDanger nz-popconfirm
              nzPopconfirmTitle="Are you sure delete this task?"
              nzPopconfirmPlacement="bottom"
              (nzOnConfirm)="confirm(item._id)"
              (nzOnCancel)="cancel()">删除</button>
    </td>
  </tr>
  </tbody>
</nz-table>
<nz-drawer
  [nzClosable]="false"
  [nzVisible]="visible"
  nzPlacement="right"
  nzTitle="角色信息修改"
  [nzWidth]="600"
  (nzOnClose)="close()"
>
  <div nz-row class="item">
    <div nz-col nzSpan="2">名称：</div>
    <div nz-col nzSpan="22"><input nz-input placeholder="Basic usage" [(ngModel)]="edit.title"/></div>
  </div>
  <div nz-row class="item">
    <div nz-col nzSpan="2">备注：</div>
    <div nz-col nzSpan="22"><input nz-input placeholder="Basic usage" [(ngModel)]="edit.description"/></div>
  </div>
  <button nz-button nzType="primary" (click)="update()">修改</button>
</nz-drawer>
<nz-drawer
  [nzClosable]="false"
  [nzVisible]="visibleAuth"
  nzPlacement="right"
  [nzTitle]="edit._id ? '角色权限修改' : '角色权限添加'"
  [nzWidth]="600"
  (nzOnClose)="closeAuth()"
>
  <nz-tree
    #nzTreeComponent
    [nzData]="authList"
    nzCheckable
    [nzCheckedKeys]="defaultCheckedKeys"
    [nzExpandedKeys]="defaultExpandedKeys"
    [nzSelectedKeys]="defaultSelectedKeys"
    (nzClick)="nzClick($event)"
    (nzContextMenu)="nzClick($event)"
    (nzCheckBoxChange)="nzCheck($event)"
    (nzExpandChange)="nzCheck($event)"
  ></nz-tree>
  <button nz-button nzType="primary" (click)="updateAuth()">{{edit._id ? '修改' : '添加'}}</button>
</nz-drawer>

